<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FBGraph.PagedResult<Event>>" %>

<asp:Content ID="t" ContentPlaceHolderID="TitleContent" runat="server">Events Demo</asp:Content>

<asp:Content ID="c" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Events Demo</h2>
    
    <div class="section">
        <h3>Create an Event</h3>
        <div class="content">
            <% using (Html.BeginForm("create", "events")) { %>
            <label for="eventName">Name: </label>
            <%= Html.TextBox("eventName") %>
            <input type="submit" value="Create" />
            <% } %>
        </div>
    </div>
    
    <% foreach (var evnt in Model.Data) { %>
    <div class="event">
        <h3><%= Html.ActionLink(evnt.Name, "detail", new { id = evnt.Id }) %></h3>
        <div class="actions">
            [<%= Html.ActionLink("Attending", "attend", new { id = evnt.Id }) %>]
            [<%= Html.ActionLink("Maybe", "maybe", new { id = evnt.Id }) %>]
            [<%= Html.ActionLink("Decline", "decline", new { id = evnt.Id }) %>]
        </div>
        <ul>
            <li>Date/Time: <%= evnt.StartTime %>  - <%= evnt.EndTime %></li>
            <li>Location: <%= evnt.Location %></li>
        </ul>
    </div>
    <% } %>

</asp:Content>
